x86: ensure copying runstate/time to L1 rather than L2
authorHaozhong Zhang <haozhong.zhang@intel.com>
Wed, 1 Mar 2017 09:29:57 +0000 (10:29 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 1 Mar 2017 09:29:57 +0000 (10:29 +0100)
commit2f0691862c8ba3940ff522ab2867b322804c3df9
treebac265529e5e3864a7dd17fdab59fa64204509eb
parent3c7177e208bcd23c09db2b56dc503e54ac31d2d5
x86: ensure copying runstate/time to L1 rather than L2

For a HVM domain, if a vcpu is in the nested guest mode,
__raw_copy_to_guest(), __copy_to_guest() and __copy_field_to_guest()
used by update_runstate_area() and update_secondary_system_time() will
copy data to L2 guest rather than the L1 guest.

This commit temporally clears the nested guest flag before all guest
copies in update_runstate_area() and update_secondary_system_time(),
and restores the flag after those guest copy operations.

The flag clear/restore is combined with the existing
smap_policy_change() which is renamed to update_guest_memory_policy().

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/time.c
xen/include/asm-x86/domain.h